/*
 * Copyright (C) 2020 xuexiangjys(xuexiangjys@163.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.dona.imsidetector.utils;

import android.content.Context;
import android.graphics.drawable.Drawable;

import com.dona.imsidetector.R;
import com.xuexiang.xaop.annotation.MemoryCache;
import com.xuexiang.xui.adapter.simple.AdapterItem;
import com.xuexiang.xui.utils.ResUtils;
import com.xuexiang.xui.widget.banner.widget.banner.BannerItem;

import java.util.ArrayList;
import java.util.List;

/**
 * 演示数据
 *
 * @author xuexiang
 * @since 2018/11/23 下午5:52
 */
public class DataProvider {

    public static String[] titles = new String[]{
            "M300",
            "御 Mavic Air 2",
    };

    public static String[] urls = new String[]{//640*360 360/640=0.5625
            "http://nasas.oicp.vip:808/public/uploads/apk/banner01.jpg",
            "http://nasas.oicp.vip:808/public/uploads/apk/banner04.jpg",
    };

    @MemoryCache
    public static List<BannerItem> getBannerList() {
        List<BannerItem> list = new ArrayList<>();
        for (int i = 0; i < urls.length; i++) {
            BannerItem item = new BannerItem();
            item.imgUrl = urls[i];
            item.title = titles[i];

            list.add(item);
        }
        return list;
    }

//
//    public static List<AdapterItem> getGridItems(Context context) {
//        return getGridItems(context, R.array.grid_titles_entry, R.array.grid_icons_entry);
//    }


    private static List<AdapterItem> getGridItems(Context context, int titleArrayId, int iconArrayId) {
        List<AdapterItem> list = new ArrayList<>();
        String[] titles = ResUtils.getStringArray(titleArrayId);
        Drawable[] icons = ResUtils.getDrawableArray(context, iconArrayId);
        for (int i = 0; i < titles.length; i++) {
            list.add(new AdapterItem(titles[i], icons[i]));
        }
        return list;
    }


    public static List<Object> getUsertGuides() {
        List<Object> list = new ArrayList<>();
//        list.add(R.drawable.guide_img_1);
//        list.add(R.drawable.guide_img_2);
//        list.add(R.drawable.guide_img_3);
//        list.add(R.drawable.guide_img_4);
        return list;
    }

    public static List<String> getStepMessage(){
        List<String> list = new ArrayList<>();
        list.add("步骤一：如果不是地面站，有楼高，请先飞到基站底部，按C2确认当前楼高，C1跳过");
        list.add("步骤二：请飞到基站附近拍摄全景图，按C2拍摄，C1跳过");
        list.add("步骤三：方向角测量，请飞近天线正面(6米内)，点击遥控器C2进行确定操作,点击C1跳过本步骤");
        list.add("步骤四：下倾角测量，请飞近天线侧面(6米内)，点击遥控器C2进行确定操作,点击C1跳过本步骤");
        list.add("步骤五：请飞到接近基站顶部进行环境覆盖图拍摄，点击C2开启拍摄操作，C1跳过本步骤");
        list.add("步骤六：请飞到接近基站顶部进行VR全景拍摄，点击C2开启拍摄操作，C1跳过本步骤");

        return list;
    }


}
